//
// Created by 33075 on 24-9-17.
//

#include "SmartCar.h"
#include <iostream>
#include <sstream>
#include <cstdlib>
using namespace std;

// 生成随机的字母和数字组合
string generateRandomString(int length) {
    string result;
    for (int i = 0; i < length; ++i) {
        if (rand() % 2 == 0) {
            result += '0' + rand() % 10;  // 生成数字字符
        } else {
            result += 'A' + rand() % 26;  // 生成字母字符
        }
    }
    return result;
}

// 手动输入智能小车信息
SmartCar inputCar(int carNumber) {
    SmartCar car;

    // 自动生成符合要求的编号：cqusn打头，后接16位数字+字母
    car.carID = "cqusn" + generateRandomString(11);  // 5个字符(cqusn) + 11个随机生成

    // 底盘编号：dp打头，后接8位数字+字母
    car.chassisID = "dp" + generateRandomString(6);  // 2(dp) + 6个随机生成

    // 固定车辆数据
    car.model = "SCOUT MINI";
    car.wheelbase = 451;
    car.trackWidth = 490;
    car.groundClearance = 115;
    car.driveType = "四轮四驱";
    car.maxRange = 10;
    car.tireModel = "公路轮";
    car.tireSize = 175;
    car.agxModel = "AGX Xavier";
    car.agxTOPS = 32;
    car.cudaCores = 512;
    car.tensorCores = 64;
    car.memory = 32;
    car.cameraModel = "RealSense D435i";
    car.lidarModel = "RS-Helios-16p";
    car.lidarRange = 100;
    car.gyroModel = "CH110";
    car.displayModel = "super";
    car.batteryCapacity = 24;

    return car;
}



